package com.prototype.demo04;

import lombok.Data;

import java.io.Serializable;

/**
 * 实现 Serializable 接口,告知JVM,该对象是可以被深度复制的.
 * 实现 Cloneable 接口,告知JVM,该对象是可以被安全复制的.
 */
@Data
public class GoldRingedStaff implements Cloneable, Serializable {
    private float diameter = 10.0f;
    private float height = 100.0f;

    // 变大
    public void grow(){
        this.diameter *= 2;
        this.height *= 2;
    }

    // 变小
    public void shrink(){
        this.diameter /= 2;
        this.height /=2;
    }

    public void move(){
        // 移动
    }
}
